import QtQuick

Image {
    id:_item

    property var picNormal
    property var picHover
    property var picPress
    property var picDisable

    signal clicked()

    source: enabled?picNormal:picDisable
    mipmap: true
    fillMode:Image.PreserveAspectFit

    MouseArea{
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton
        hoverEnabled: true

        onClicked: {
            _item.clicked()
        }

        onPressed: {
            _item.source = picPress
        }

        onEntered:{
            _item.source = picHover
        }

        onExited: {
            _item.source = picNormal
        }
        onCanceled: {
            _item.source = picNormal
        }
    }

}
